package service.Impl;

import dao.Impl.OssDaoImpl;
import dao.OssDao;
import entity.Oss;
import service.OssService;

import java.util.List;

public class OssServiceImpl implements OssService {
    OssDao ossDao = new OssDaoImpl();
    @Override
    public List<Oss> selectAll() {
        return ossDao.selectAll();
    }

    @Override
    public Oss selectBucketName(String bucketName) {
        return ossDao.selectBucketName(bucketName);
    }

    @Override
    public boolean add(Oss oss) {
        int count = -1;
        //新增
        count = ossDao.add(oss);
        return count > 0 ? true : false;
    }

    @Override
    public boolean updatePermission(String name, String permission) {
        int num = ossDao.updatePermission(name,permission);
        if (num>0){
            return true;
        }
        return false;
    }
}
